/*******************************************************************************
* CAROL CHOU
* RA8806 / 240*160 / Winbond
********************************************************************************/
#include <stdio.h>
#include <intrins.h>
#include "W78E516B.H"
#include "RA8806Reg.h"
#include "UserDef.h"	  
//------------------------------------------------------------------------------
//Complier Defines
//------------------------------------------------------------------------------
//===== LCD Panel Size =====
#ifdef P320x240
#define cAWRR		39	
#define cAWBR		239     
#define cDWRR 		39      
#define cDWBR		239 	
#endif

#ifdef P240x160
#define cAWRR		29	
#define cAWBR		159     
#define cDWRR 		29      
#define cDWBR		159 	
#endif

#ifdef BIG5_Code
#define cWLCR		B1000_1101	//BIG5 Code	
#endif

#ifdef GB_Code
#define cWLCR		B1001_1101	//GB Code	
#endif

//------------------------------------------------------------------------------
//Parameter Defines
//------------------------------------------------------------------------------
//===== MCU Interface =====
#ifdef Parallel_8080
	#define DATA_BUS		P0
	//#define bRST     		P4_1		//New Demo_Board 
	//#define bA0				P4_0		//New Demo_Board

    #define bRST     		P3_3		//35 Demo_Board 
	#define bA0				P2_0		//35 Demo_Board    

	#define bINT			P3_2
	#define bCSZ			P3_4
	#define bWRZ			P3_6
	#define bRDZ			P3_7

	#define bBUSY		    P3_3 
	#define bDB             P1_0
	#define bMI				P1_1
uchar volatile xdata CMD		_at_ 0xfeff;		//Command
uchar volatile xdata RAM		_at_ 0xffff;		//Display RAM
#endif

//Subroutine Declare
void LCD_CmdWrite(uchar);
void LCD_DataWrite(uchar);
extern void LCD_ChkBusy(void);

//Delay Function
extern void Delay2us(uchar);
extern void Delay100us(uchar);
extern void Delay1ms(uchar);
extern void Delay10ms(uchar);
extern void Delay100ms(uchar);